package manage.student.MainTableView;



import javax.swing.table.DefaultTableModel;
import java.util.Vector;

public class MainViewTableModel extends DefaultTableModel {
    static Vector<String> col=new Vector<>();

    public static Vector<String> getCol() {
        return col;
    }

    static {
        col.addElement("编号");
        col.addElement("姓名");
        col.addElement("性别");
        col.addElement("班级");
        col.addElement("语文");
        col.addElement("数学");
        col.addElement("英语");
    }
    public MainViewTableModel() {
        super(null,col);
    }
    private static MainViewTableModel  mainViewTableModel=new MainViewTableModel();

    public static MainViewTableModel assembleModel(Vector<Vector<Object>>data){
        mainViewTableModel.setDataVector(data,col);
        return mainViewTableModel;
    }

    public static void updateModel(Vector<Vector<Object>>data){
        mainViewTableModel.setDataVector(data,col);
    }

    @Override
    public boolean isCellEditable(int row, int column) {
        return false;
    }
}
